<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<%@page import="org.springframework.web.context.request.SessionScope"%><script type="text/javascript">
	/**
	* Set the Radio-Buttons Invisble
	*/
	function invisbleRadio() {
		// do nothing
	}

	/**
	 * Deactivates the show, edit and delete button.
	 */
	function deactivateButtons() {
		// do nothing
	}
</script>

<html:form action="/adCreateEditCar" method="post" enctype="multipart/form-data">
	<table>
			<tr>
				<td><b><bean:message key="label.modelName"/>:</b></td>
				<td><html:text property="car.modelName" /> <span class="validateError"><html:errors property="car.modelName" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.yearOfManufacture" />:</b></td>
				<td><html:text property="car.yearOfManufacture" /> <span class="validateError"><html:errors property="car.yearOfManufacture" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.enginePerformance" />:</b></td>
				<td><html:text property="car.enginePerformance" /> <span class="validateError"><html:errors property="car.enginePerformance" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.engineSize" />:</b></td>
				<td><html:text property="car.engineSize" /> <span class="validateError"><html:errors property="car.engineSize" /></span></td>				
			</tr><tr>					
				<td><b><bean:message key="label.manufactureCompany" />:</b></td>
				<td><html:text property="car.manufactureCompany" /> <span class="validateError"><html:errors property="car.manufactureCompany" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.descriptionText" />:</b></td>
				<td><html:textarea property="car.descriptionText" /></td>	
			</tr><tr>			
				<td><b><bean:message key="label.crew" />:</b></td>
				<td><html:text property="car.crew" /> <span class="validateError"><html:errors property="car.crew" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.measurementsLength" />:</b></td>
				<td><html:text property="car.measurementsLength" /> <span class="validateError"><html:errors property="car.measurementsLength" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.measurementsHigh" />:</b></td>
				<td><html:text property="car.measurementsHigh" /> <span class="validateError"><html:errors property="car.measurementsHigh" /></span></td>
			</tr><tr>		
				<td><b><bean:message key="label.measurementsWidth" />:</b></td>
				<td><html:text property="car.measurementsWidth" /> <span class="validateError"><html:errors property="car.measurementsWidth" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.image" />:</b></td>
				<td><html:file property="aCarImageFile" /></td>
			</tr><tr>
				<td><b><bean:message key="label.linkEquipsToCars" />:</b></td>
				<td>
					<html:select property="selectedEquipmentIds" multiple="true" size="10" >
						<html:option value=""></html:option>
						<c:forEach var="equipment" items="${sessionScope.carForm.equipments}"
							varStatus="rowStatus">
							<html:option value="${equipment.equipmentId}">${equipment.modelName}</html:option>
						</c:forEach>
					</html:select>
				</td>
				</tr>
				<tr>
				<td>
					<b><bean:message key="label.linkedEquipments" />:</b>
					</td>
				<td><c:forEach var="equipmentName" items="${sessionScope.carForm.selectedEquipmentNames}"
						varStatus="rowStatus">
						${equipmentName}<br />
					</c:forEach>
				</td>
			</tr>
	</table>
	<html:submit>
		<bean:message key="button.save" />
	</html:submit>
	<html:button property="method" onclick="history.back();">
		<bean:message key="button.back" />
	</html:button>
</html:form>